home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tspa3140.zip / TSUNTH.INT < prev    next >
Text File  |  1992-06-13  |  6KB  |  156 lines

  1. {$B-,D-,F-,I+,N-,R-,S+,V+}
  2.  
  3. (*
  4. Timo Salmi UNiT H
  5. A Turbo Pascal unit of system information and more miscellania
  6. All rights reserved 24-Feb-90
  7. Updated 15-Apr-90, 23-Jul-90, 1-Aug-90, 8-Aug-90, 5-Jan-90, 22-Jul-91
  8.         24-Nov-91
  9.  
  10. In the 24-Nov-91 update part of the old routines has been transferred to
  11. TSUTNTJ because this TSUNTH unit started to grow too much.  The transferred
  12. routines were
  13.   COPYFILE Copy a file from within a Turbo Pascal program
  14.   ISDIRFN  Is a name a directory or not
  15.   OPENEDFN Is an assigned textfile still open or not
  16.   PIPEDIFN Is the standard input from redirection
  17.   PIPEDNFN Is the standard output redirected to nul
  18.   PIPEDOFN Is the standard output redirected
  19.  
  20. This unit may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
  21. NON-INSTITUTIONAL purposes, provided it is not changed in any way. For
  22. ANY other usage, such as use in a business enterprise or a university,
  23. contact the author for the terms of registration.
  24.  
  25. The units are under development. Comments and contacts are solicited. If
  26. you have any questions, please do not hesitate to use electronic mail for
  27. communication.
  28. InterNet address: ts@chyde.uwasa.fi         (preferred)
  29. Funet address:    GADO::SALMI
  30. Bitnet address:   SALMI@FINFUN.BITNET
  31.  
  32. The author shall not be liable to the user for any direct, indirect or
  33. consequential loss arising from the use of, or inability to use, any unit,
  34. program or file howsoever caused. No warranty is given that the units and
  35. programs will work under all circumstances.
  36.  
  37. Timo Salmi
  38. Professor of Accounting and Business Finance
  39. Faculty of Accounting & Industrial Management; University of Vaasa
  40. P.O. BOX 297, SF-65101 Vaasa, Finland
  41. *)
  42.  
  43. unit TSUNTH;
  44.  
  45. (* ======================================================================= *)
  46.                           interface
  47. (* ======================================================================= *)
  48.  
  49. uses Dos
  50.      {$IFDEF VER40}
  51.      ,TSUNT45
  52.      {$ENDIF}
  53.      ;
  54.  
  55. (* ====================================================================
  56.                   Software information
  57.    ==================================================================== *)
  58.  
  59. (* Graftabl MsDos command loads the extended character set to be used in
  60.    the graphics mode.  This function tells whether the table has been
  61.    already loaded, or not *)
  62. function GRTABLFN : boolean;
  63.  
  64. (* Returns the country code if MsDos 3+. For an error and earlier MsDos
  65.    versions returns zero. See MsDos manual "How to use Code Pages" for
  66.    the country codes *)
  67. function COUNTRFN : word;
  68.  
  69. (* Return the country-dependent date format, reguires 3.0+,
  70.    Principal return formats: MM-DD-YY       ('-' or whatever is the
  71.                              DD-MM-YY        relevant separator)
  72.                              YY-MM-DD
  73.    On error or MsDos < 3.0 returns ('XX*XX*XX');
  74.    Norton & Wilton ss. 358-360, 412, Duncan 395-398, Dettmann 586 *)
  75. function DATEFMFN : string;
  76.  
  77. (* Return the country-dependent time format, reguires 3.0+,
  78.    Principal return formats: 12-hour HH:MM:SS   (':' or whatever is the
  79.                              24-hour HH:MM:SS    relevant separator)
  80.    On error or MsDos < 3.0 returns ('00h');
  81.    Norton & Wilton ss. 358-360, 412, Duncan 395-398, Dettmann 586 *)
  82. function TIMEFMFN : string;
  83.  
  84. (* Returns from which drive the system was booted, requires MsDos 4.0+,
  85.    else returns '.' *)
  86. function BOOTDRFN : char;
  87.  
  88. (* ====================================================================
  89.                   Hardware information
  90.    ==================================================================== *)
  91.  
  92. (* Is a math coprocessor present. And, yes, yes, I know that there is a
  93.    Test8087 variable in Turbo Pascal, but I have found it unreliable *)
  94. function MATHCOFN : boolean;
  95.  
  96. (* Number of serial ports *)
  97. function RS232FN : byte;
  98.  
  99. (* Number of parallel ports (printers installed) *)
  100. function PARPORFN : byte;
  101.  
  102. (* Is mouse hardware and driver present, a simple true / false test *)
  103. function ISMOUSFN : boolean;
  104.  
  105. (* Status of the mouse hardware and driver
  106.    0 : no mouse
  107.    1 : mouse with other than two buttons
  108.    2 : mouse with two buttons
  109.    3 : Mouse Systems or Logitech mouse
  110.    4 : Unknown or unresolved mouse status *)
  111. function MOUSTAFN : byte;
  112.  
  113. (* Returns the type of the processor chip. If not known, returns the
  114.    string 'error'. This function is based on the public inline code in
  115.    Michael Tischer, PC System Programming for Developers, Abacus, p. 660.
  116.    I have written the interface to it. Does not detect 80486. Sometimes
  117.    gives conflicting information. Use with care, if at all. There are
  118.    alternatives *)
  119. function CHIPFN : string;
  120.  
  121. (* Get the version (date) of the ROM BIOS. It is of the format mm/dd/yy.
  122.    Returns 'NotKnown' if unavailable *)
  123. function ROMDTEFN : string;
  124.  
  125. (* Is the keyboard an enhanced keyboard *)
  126. function ISENHAFN : boolean;
  127.  
  128. (* Last drive of the system, softcoded, not for XTs *)
  129. function LASTDRFN : char;
  130.  
  131. (* This function gives the interleave factor of a given drive.
  132.    If you give a non-existent drive name, interlfn return zero.
  133.    This is for fixed disks. Applying on a floppy drive will give
  134.    nonsensical values, not for XTs. I am not convinced that this
  135.    works with all the different conrollers around *)
  136. function INTERLFN (drive : char) : byte;
  137.  
  138. (* Number of FATs, not for XTs *)
  139. function FATSFN (drive : char) : byte;
  140.  
  141. (* Number of cylinders on a device, requires MsDos 3.2+.
  142.    In case of modia not present, error, or wrong MsDos version,
  143.    returns 0 *)
  144. function NRCYLFN (drive : char) : byte;
  145.  
  146. (* ====================================================================
  147.                       Perform tasks
  148.    ==================================================================== *)
  149.  
  150. (* Convert an Asciiz (#0 limited) string into an ordinary ascii string.
  151.    Some of the routines in this unit internally need Z2ASCFN, but why
  152.    not make it also generally available as well *)
  153. function Z2ASCFN (asciiz : string) : string;
  154.  
  155.  
  156.